<?php
/**
 * Created by PhpStorm.
 * User: angl
 * Date: 2016/10/10
 * Time: 14:25
 */
namespace AuctionCore\AntNest;

class Sms extends Client
{
    public function __construct()
    {
        $this->urlPath = 'sms/api/';
    }

    /**
     * 短信通知
     * @param int $number
     * @param string $mobile
     * @param array $content_params
     * @return mixed
     */
    public function notify($number, $mobile, $content_params)
    {
        $this->urlPath = $this->urlPath . "notify";
        $this->params = array(
            'number' => $number,
            'mobile' => $mobile,
            'content_params' => $content_params
        );
        return $this->send();
    }


    /**
     * 发送验证码
     * @param $number
     * @param $mobile
     * @return mixed
     */
    public function codeSend($number, $mobile)
    {
        $this->urlPath = $this->urlPath . "codesend";
        $this->params = [
            'number' => $number,
            'mobile' => $mobile
        ];
        return $this->getData();
    }

    /**
     * 校验验证码
     * @param $number
     * @param $mobile
     * @param $ver_code
     * @return mixed
     */
    public function verify($number,$mobile,$ver_code)
    {
        $this->urlPath = $this->urlPath . "verify";
        $this->return_data = false;
        $this->params = [
            'number' => $number,
            'mobile' => $mobile,
            'ver_code' => $ver_code
        ];
        return $this->send();
    }
}